package com.example.departmentService.controller;


import com.example.departmentService.entity.TalentPool;
import com.example.departmentService.service.ITalentPoolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Api(value = "/talentpool", tags = "人才库")
@RestController
@RequestMapping("/talentpool")
public class TalentPoolController {
    @Autowired
    private ITalentPoolService talentPoolService;

    @ApiOperation(value = "添加人才", notes = "添加人才")
    @PostMapping("/insert")
    @CrossOrigin(origins = "*")
    public Integer insert(@RequestBody TalentPool talentPool) {
        return talentPoolService.insert(talentPool);
    }

    @ApiOperation(value = "查询所有人才信息", notes = "查询所有人才信息")
    @PostMapping("/findAll")
    @CrossOrigin(origins = "*")
    public List<TalentPool> findAll() {
        List<TalentPool>  talentPools = talentPoolService.findAll();
        return talentPools;
    }

    @ApiOperation(value = "查询人才信息", notes = "查询人才信息")
    @PostMapping("/selectList")
    @CrossOrigin(origins = "*")
    public List<TalentPool> selectList(TalentPool talentPool) {
        List<TalentPool>  talentPools = talentPoolService.selectList(talentPool);
        return talentPools;
    }
}
